@extends('default.layouts.companyRegisterHF')
@section('title')企业会员注册 | {{Site::get('webname')}} @endsection

@section('headcss')
    @parent
    <link rel="stylesheet" href="{{asset('/default/css/company/register.css')}}">
@endsection

@section('content')
    {{--企业会员注册信息--}}
    <div class="content">
        <div class="reg">
            <div class="regInfo">
                {{--企业会员注册--}}
                <div class="headTop">
                    <div class="rCorporate"><span>注册企业账号</span></div>
                    <div class="headRight">
                        <span class="have">已有账号</span>
                        <span class="rLogin"><a href="{{url('company/welcome')}}">登录</a> </span>
                    </div>
                </div>
                {{--公司信息--}}
                <form action="{{url('company/ordinary_register')}}" method="post" name="regForm" id="regForm">
                    {{csrf_field()}}
                    <div class="regForm comInfo">
                        {{--输出全部错误信息--}}
                        @if(count($errors)>0)
                            <div class="errors" style="padding-bottom: 10px">
                                <ul>
                                    @if(is_object($errors))
                                        @foreach($errors->all() as $error)
                                            <li><span>{{$error}}</span></li>
                                        @endforeach
                                    @else
                                        <li><span>{{$error}}</span></li>
                                    @endif
                                </ul>
                            </div>
                        @endif
                        <div class="fTitle">
                            <span class="line"><span>公司信息</span></span>
                        </div>
                        <div class="formCon">
                            <dl>
                                <dt><span class="caption">公司名称</span><span class="asterisk">*</span></dt>
                                <dd style="position:relative">
                                    <input type="text" name="company_name" id="company_name" value="{{old('company_name')}}" placeholder="请输入公司名称" tip="请输入公司名称">
                                    <span class="switchMode"><a href="{{url('company/register')}}">切换手机模式</a></span>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">联系人</span><span class="asterisk">*</span></dt>
                                <dd><input type="text" name="contacts" id="contacts" style="width:178px;"  value="{{old('contacts')}}" placeholder="请输入联系人" tip="请输入联系人"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">电子邮箱</span></dt>
                                <dd><input type="text" name="email" id="email"  style="width:240px;" value="{{old('email')}}" placeholder="请输入邮箱" tip="请输入邮箱"></dd>
                                <dd class="errinfo"></dd>
                            </dl>

                            <dl>
                                <dt><span class="caption">联系电话</span><span class="asterisk">*</span></dt>
                                <dd>
                                    <input type="text" name="area_code" id="area_code" style="width:50px;"  value="{{old('area_code')}}" placeholder="区号">
                                    <input type="text" name="phone" id="phone" style="width:140px; margin-left: 10px;"  value="{{old('phone')}}" placeholder="请输入电话" tip="请输入电话" >
                                    <input type="text" name="ext" id="ext" style="width:50px;margin-left: 10px;"  value="{{old('ext')}}" placeholder="分机号">
                                </dd>
                                <dd class="errinfo" style="width: 220px;"></dd>
                            </dl>
                        </div>
                    </div>

                    {{--//账户信息--}}
                    <div class="regForm accInfo">
                        <div class="fTitle">
                            <span class="line"><span>账号信息（用于下次登录）</span></span>
                        </div>
                        <div class="formCon comInfo">
                            <dl>
                                <dt><span class="caption">用户名</span><span class="asterisk">*</span></dt>
                                <dd><input type="text" name="username" id="username" value="{{old('username')}}" placeholder="请输入用户名" tip="请输入用户名"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">创建密码</span><span class="asterisk">*</span></dt>
                                <dd><input type="password" name="password" id="password"  value="{{old('password')}}" placeholder="请输入密码" tip="请输入密码"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">确认密码</span><span class="asterisk">*</span></dt>
                                <dd><input type="password" name="password_confirmation" id="password_confirmation"  value="{{old('password_confirmation')}}" placeholder="请输入确认密码" tip="请输入确认密码"></dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl>
                                <dt><span class="caption">验证码</span><span class="asterisk">*</span></dt>
                                <dd><input name="code" id="code" type="text" class="code" style="width:150px "  placeholder="请输入验证码"   tip="请输入验证码"   value="{{ old('code') }}"/></dd>
                                <dd style=" width:100px; margin-right: 0px; margin-left: 5px; display: block">
                                    <span class="getcode"><img  id="getcode" src="{{captcha_src()}}" alt="" onclick="this.src='{{captcha_src()}}' + Math.random()"></span>
                                </dd>
                                <dd style=" width:60px; margin-right: 0px; margin-left: 5px; display: block">
                                    <span class="another"><a  onclick="document.getElementById('getcode').src='{{captcha_src()}}' + Math.random()">换一张</a></span>
                                </dd>
                                <dd class="errinfo"></dd>
                            </dl>
                            <dl style=" margin: 5px">
                                <dt></dt>
                                <dd class="tips">点击下一步即表示您同意<a target="_blank" href="{{url('webcontent_agreement.html')}}">&lt;&lt;注册协议&gt;&gt;</a></dd>
                            </dl>

                            <dl>
                                <dt></dt>
                                <dd><input type="submit" name="sub" id="sub" class="sub" value="下一步" ></dd>
                            </dl>

                        </div>
                    </div>
                </form>
                {{--//注册表单--}}
            </div>
        </div>
    </div>
@endsection

@section('footerjs')
    @parent
    {{--JS信息--}}
    <script>
        var userUrl = "{{ url('company/ajax_username') }}";
        var _token = "{{csrf_token()}}";
        $(function(){
            @if(!empty(session('err')))
               layer.ready(function(){
                    layer.msg('{{session('err')}}');
                });
            @endif
        })
    </script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.validate.extend.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/jquery/jquery.enplaceholder.js')}}"></script>
    <script type="text/javascript" src="{{asset('/default/js/company/ordinary_register.js')}}"></script>
@endsection